package com.example.springcloud.alibaba.service.impl;

import com.example.springcloud.alibaba.dao.StorageDao;
import com.example.springcloud.alibaba.service.StorageService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
public class StorageServiceImpl implements StorageService {
    @Resource
    private StorageDao storageDao;

    @Override
    @Transactional
    public boolean updateUseNum(long productId, long used) {
        int index = storageDao.updateUsed(productId,used);
        return index > 0;
    }
}
